package com.ljtg.ljtgservice.mapper;

import com.ljtg.ljtgpojo.entity.Commodity;
import com.ljtg.ljtgpojo.entity.CommodityDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommodityDetailMapper {

        /*
    * 批量插入商品属性数据
     */
    void insert(List<CommodityDetail> details);

    /*
    * 根据商品id删除商品属性数据
    * */
    @Delete("delete from commodity_detail where commodity_id=#{commodityId}")
    void deleteByCommodityId(Long commodityId);


    //根据商品id查询商品属性数据
    @Select("select * from commodity_detail where commodity_id =#{commodityId}")
    List<CommodityDetail> getById(Long commodityId);

}
